1. Field of Invention
The present invention relates to a method for processing videos, and particularly to a method and an apparatus for processing videos, which are capable of correctly judging video modes.
2. Description of the Related Art
Among conventional film modes, shooting movies on film is very common, in which 24 complete frames are recorded per second (24 fps), while the file format thereof requires to record a footage in a film rate of 24 fps too. In comparison with the 24 fps film rate, however, there are other film modes where a footage is recorded in a rate of 30 complete frames per second (30 fps), while the file format thereof requires to record a footage in a film rate of 30 fps as well.
The conventional video broadcasting media, for example, cable TV or broadcast TV, usually use NTSC or PAL broadcasting mode to transmit video signals, where NTSC refers to National Television System Committee and PAL refers to Phase Alternative Line. For NTSC broadcasting mode, the broadcasting frequency is set to 60 Hz, that is, a user end would receive 60 interlaced frames per second from a TV station, while for PAL broadcasting mode, the broadcasting frequency is set to 50 Hz. The above-mentioned interlaced frames mean that for an odd frame, only all odd scan lines, for example, 1st, 3rd, 5th and so on, are accompanied with images and no image exists corresponding to any even scan line; for an even frame, only all even scan lines, for example, 2nd, 4th, 6th and so on, are accompanied with images and no image exists corresponding to any odd scan line.
Hence, for those film modes with 30 fps or 24 fps film rate, if the broadcasting rate is set to 60 Hz as specified by NTSC, a 2-2 pulldown or a 3-2 pulldown process must be executed prior to broadcasting. FIG. 1 is a diagram showing a conventional 2-2 pulldown mode used for converting the frame format of a 30 Hz film. Referring to FIG. 1, frame 101, 102, . . . , 130 denote 30 complete image frames recorded in one second, wherein the first frame 101 is divided into an even frame 101e where only all even scan lines are accompanied with images and an odd frame 101o where only all odd scan lines are accompanied with images. The same process is applied to other frames, so that 60 interlaced frames, i.e. 101e, 101o, 102e, 102o, . . . , 130e, and 130o, are obtained (where a frame with a suffix “e” represents an even frame where only all even scan lines are accompanied with images and a frame with a suffix “o” represents a frame where only all odd scan lines are accompanied with images). Thus, the processed movie complies with NTSC specification where the broadcasting frequency is 60 Hz required.
FIG. 2 is a diagram showing a conventional 3-2 pulldown mode used for converting the frame format of a 24 fps film. Referring to FIG. 2, frame 201, 202, 203, . . . , 224 denote 24 complete image frames recorded in one second, wherein the first frame 201 is divided into interlaced frames 201e and 201o. After that, the second frame 202 is divided into frames 202e and 202o and 202e. Further, the third frame 203 is divided into frames 203e and 203o. The same process is applied to other frames, so that 60 interlaced frames, i.e. frame 201e, 201o, 202e, 202o, . . . , 224e, 224e and 224o, are obtained and the processed movie is complied with NTSC specification where the broadcasting frequency is 60 Hz required.
In addition, for those film modes with 24 fps film rate, if the broadcasting rate is set to 50 Hz as specified by PAL, a 2-2 pulldown process is to be executed prior to broadcasting. FIG. 3 is a diagram showing a conventional 2-2 pulldown mode used for converting the frame format of a 24 fps film. Referring to FIG. 3, frame 301, 302, . . . , 324 denote 24 complete image frames recorded in one second, wherein the first frame 301 is divided into interlaced frames 301e and 301o. The same process is applied to other frames, so that 48 interlaced frames, i.e. frame 301e, 301o, 302e, 302o, . . . , 324e, and 324o, are obtained. After further adjustment, a movie complying with PAL specification with 50 Hz broadcasting frequency is obtained.
For a playback mode with higher quality in an image display apparatus at a user end, for example, a high definition TV (HDTV), in order to get better display quality, the following processing steps are performed prior to playback: first, the received frames are determined to be interlaced frames after 2-2 pulldown or 3-2 pulldown processing; next, an inverse telecine (IVTC) is performed on the interlaced frames to obtain complete frames for playback. For example, after the interlaced frames 201e, . . . , 224o as shown in FIG. 2 are received, the frames 201e and 201o are combined to form a complete frame 201, while the frames 202e and 202o are combined to form a complete frame 202. The same process is applied to other frames, so that 24 complete frames 201, 202, . . . , 224 are obtained in the end.
FIG. 4 is a diagram showing the format of a film with 3-2 pulldown mode after IVTC processing. As shown in FIG. 4, the complete frame 201 obtained by foregoing process is played twice to obtain the frames 201p and 201p, and the complete frame 203 is played three times to obtain the frames 202p, 202p and 202p. The same process is applied to other frames, so that 60 complete frames can be displayed every one second by means of the playback mode as shown in FIG. 4. In comparison with the conventional TV where 60 interlaced frames are displayed every one second, the mode of FIG. 4 enables the displayed frames to appear quite smoothly without image flaws such as skipping, combing or color smearing.
In the conventional broadcasting modes of video data, the method for judging the movie mode (or pulldown mode) of the received frames (2-2 pulldown mode or 3-2 pulldown mode) includes following steps: first, performing subtractions between the pixel values of every pair of corresponding pixels of any two consecutive frames to obtain a plurality of difference values of the pixels for the two consecutive frames. Next, the pixel value differences are added together to obtain a difference value corresponding to the two consecutive frames. The above-described steps are repeated to obtain the difference values for all frames, and a difference value sequence is formed by collecting those difference values. Afterwards, the difference value sequence is compared with a threshold value to obtain a binary sequence where if the difference value is larger than the threshold value, the value of the binary sequence is set to logic 1, and if the difference value is smaller than the threshold value, the value of the binary sequence is set to logic 0. Finally, the binary sequence cadence is analyzed to judge the movie mode adopted by the original frames.
The drawback of the above-described method is that the differences between some consecutive frames and the resulted difference values thereof in the video data may be too small to determine a threshold value or to judge the adopted movie mode.